package com.uchiha.nova.core.tool.util;

import cn.hutool.core.bean.BeanUtil;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 周林静
 * @Date 2023-01-02,0002 10:29
 * @Version 1.0
 */
public class BeanToMapUtil {
    /**
     * 多对象转map
     *
     * @param list
     * @return
     */
    public static Map<String,Object> beanToMap(List<Object> list) {
        Map<String,Object> map = new HashMap<>();
        list.stream().forEach(dto->{
            BeanUtil.copyProperties(dto,map);
        });
        return map;
    }
}

